const app = getApp();

Page({
  data: {
    /** 步骤数据 */
    stepList: [],
    /** 步骤一：已受理 */
    step1: [
      {
        title: "已受理",
        icon: "https://cjbtest.mynatapp.cc/statics/images/maeve/common/dot-process.png",
        status: "process",
      },
      {
        title: "待上门",
        icon: "https://cjbtest.mynatapp.cc/statics/images/maeve/common/dot-default.png",
        status: "default",
      },
      {
        title: "服务中",
        icon: "https://cjbtest.mynatapp.cc/statics/images/maeve/common/dot-default.png",
        status: "default",
      },
      {
        title: "已完成",
        icon: "https://cjbtest.mynatapp.cc/statics/images/maeve/common/dot-default.png",
        status: "default",
      },
    ],
    /** 步骤二：待上门 */
    step2: [
      {
        title: "已受理",
        icon: "https://cjbtest.mynatapp.cc/statics/images/maeve/common/dot-finish.png",
        status: "finish",
      },
      {
        title: "待上门",
        icon: "https://cjbtest.mynatapp.cc/statics/images/maeve/common/dot-process.png",
        status: "process",
      },
      {
        title: "服务中",
        icon: "https://cjbtest.mynatapp.cc/statics/images/maeve/common/dot-default.png",
        status: "default",
      },
      {
        title: "已完成",
        icon: "https://cjbtest.mynatapp.cc/statics/images/maeve/common/dot-default.png",
        status: "default",
      },
    ],
    /** 步骤三：服务中 */
    step3: [
      {
        title: "已受理",
        icon: "https://cjbtest.mynatapp.cc/statics/images/maeve/common/dot-finish.png",
        status: "finish",
      },
      {
        title: "待上门",
        icon: "https://cjbtest.mynatapp.cc/statics/images/maeve/common/dot-finish.png",
        status: "finish",
      },
      {
        title: "服务中",
        icon: "https://cjbtest.mynatapp.cc/statics/images/maeve/common/dot-process.png",
        status: "process",
      },
      {
        title: "已完成",
        icon: "https://cjbtest.mynatapp.cc/statics/images/maeve/common/dot-default.png",
        status: "default",
      },
    ],
    /** 步骤四：已完成 */
    step4: [
      {
        title: "已受理",
        icon: "https://cjbtest.mynatapp.cc/statics/images/maeve/common/dot-finish.png",
        status: "finish",
      },
      {
        title: "待上门",
        icon: "https://cjbtest.mynatapp.cc/statics/images/maeve/common/dot-finish.png",
        status: "finish",
      },
      {
        title: "服务中",
        icon: "https://cjbtest.mynatapp.cc/statics/images/maeve/common/dot-finish.png",
        status: "finish",
      },
      {
        title: "已完成",
        icon: "https://cjbtest.mynatapp.cc/statics/images/maeve/common/dot-process.png",
        status: "process",
      },
    ],
  },
  onLoad() {
    // 画面初始状态下为步骤1
    this.setData({
      stepList: this.data.step1
    })
  },

  /**
   * 步骤刷新测试
   */
  onRefreshStepTap() {
    // 这个位置模拟的是实际业务中页面下拉刷新当前画面，更新进度条。此处为了方便，使用button进行测试
    this.setData({
      stepList: this.data.step2,
    })
  }
});
